package com.ruoyi.web.controller.ring;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.ring.domain.RingMyOtherSet;
import com.ruoyi.ring.service.IRingMyOtherSetService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 我的戒指其他设置Controller
 * 
 * @author liuwp
 * @date 2025-10-15
 */
@RestController
@RequestMapping("/ring/ring_my_other_set")
public class RingMyOtherSetController extends BaseController
{
    @Resource
    private IRingMyOtherSetService ringMyOtherSetService;

    /**
     * 查询我的戒指其他设置列表
     */
    @PreAuthorize("@ss.hasPermi('ring:ring_my_other_set:list')")
    @GetMapping("/list")
    public TableDataInfo list(RingMyOtherSet ringMyOtherSet)
    {
        startPage();
        List<RingMyOtherSet> list = ringMyOtherSetService.selectRingMyOtherSetList(ringMyOtherSet);
        return getDataTable(list);
    }

    /**
     * 导出我的戒指其他设置列表
     */
    @PreAuthorize("@ss.hasPermi('ring:ring_my_other_set:export')")
    @Log(title = "我的戒指其他设置", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, RingMyOtherSet ringMyOtherSet)
    {
        List<RingMyOtherSet> list = ringMyOtherSetService.selectRingMyOtherSetList(ringMyOtherSet);
        ExcelUtil<RingMyOtherSet> util = new ExcelUtil<RingMyOtherSet>(RingMyOtherSet.class);
        util.exportExcel(response, list, "我的戒指其他设置数据");
    }

    /**
     * 获取我的戒指其他设置详细信息
     */
    @PreAuthorize("@ss.hasPermi('ring:ring_my_other_set:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(ringMyOtherSetService.selectRingMyOtherSetById(id));
    }

    /**
     * 新增我的戒指其他设置
     */
    @PreAuthorize("@ss.hasPermi('ring:ring_my_other_set:add')")
    @Log(title = "我的戒指其他设置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody RingMyOtherSet ringMyOtherSet)
    {
        return toAjax(ringMyOtherSetService.insertRingMyOtherSet(ringMyOtherSet));
    }

    /**
     * 修改我的戒指其他设置
     */
    @PreAuthorize("@ss.hasPermi('ring:ring_my_other_set:edit')")
    @Log(title = "我的戒指其他设置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody RingMyOtherSet ringMyOtherSet)
    {
        return toAjax(ringMyOtherSetService.updateRingMyOtherSet(ringMyOtherSet));
    }

    /**
     * 删除我的戒指其他设置
     */
    @PreAuthorize("@ss.hasPermi('ring:ring_my_other_set:remove')")
    @Log(title = "我的戒指其他设置", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(ringMyOtherSetService.deleteRingMyOtherSetByIds(ids));
    }
}
